Field of the Invention
One disclosed aspect of the embodiments relates to a technique for adding shade to image data.
Description of the Related Art
When an image of a subject is captured using an imaging apparatus or device, illumination conditions, such as a light amount and a direction of light for the subject, greatly influence the appearance of the captured image. For example, when light is obliquely incident upon a subject, a three-dimensional effect of the subject is emphasized. When light is incident upon a subject from the rear, the front of the subject is in shadow and therefore, an image gives a dim and flat impression. As a method for adjusting the appearance of such an image, Japanese Patent No. 5088220 discusses a method for generating an image under virtual illumination conditions by using three-dimensional shape data corresponding to the subject. More specifically, in the technique discussed in Japanese Patent No. 5088220, an image under virtual illumination conditions is rendered using three-dimensional shape data, and then this image is placed in a region where a subject is present in a captured image, so that an image under different illumination conditions is generated. As another method, Japanese Patent No. 5147287 discusses a method for estimating a normal direction of a surface of a subject from a captured image, and generating an image under virtual illumination conditions based on the estimated normal direction. More specifically, in the technique discussed in Japanese Patent No. 5147287, the normal direction is estimated from brightness information of the captured image, and an image, in which lighting is corrected based on the normal direction, is generated.
However, the technique discussed in Japanese Patent No. 5088220 has the following problem. In this technique, the image rendered from the three-dimensional shape data is a computer graphics (CG) image, and this CG image and the captured image are synthesized. Therefore, if position adjustment between the CG image and the captured image is poor, a strange image is obtained. The technique discussed in Japanese Patent No. 5147287 also has a problem. In this technique, the normal direction is estimated based on the brightness of the captured image and therefore, the correct normal direction cannot be estimated if noise and shadow are included in the subject image.